package mybatisgen.demo.service;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum DataBase {

    sita("sita", "sita_sit", "IuJ8CF1DxwG7", "jdbc:mysql://t5og60hndy5cw.cn-shanghai.oceanbase.aliyuncs.com:3306/sita"),
    crm("crm", "crm_cloud2", "pEsSkp49", "jdbc:mysql://t57v73nvgsbsw.oceanbase.aliyuncs.com:3306/crm"),
    weibao("weibao", "zhdb", "~#HMuXoy_5gJu#", "jdbc:mysql://172.29.200.16:3516/weibao"),
    ;
    private String sysCode;
    private String name;
    private String password;
    private String url;

    public static DataBase getBySysCode(String sysCode) {
        for (DataBase dataBase : DataBase.values()) {
            if (dataBase.getSysCode().equals(sysCode)) {
                return dataBase;
            }
        }
        return null;
    }
}
